<tagLib name="cx,html" />
<link href="../Public/Css/ui.tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../Public/Js/ui.core.js"></script>
<script type="text/javascript" src="../Public/Js/ui.tabs.js"></script>
<html:link type="JS" href="../Public/Js/common.js" />
<script language="javascript">
ROOT = '__ROOT__';

function showMoveDiv(cid)
{
	$('#originCid').attr("value",cid);
	$('#newCid').attr("value",cid);
	tb_show("移动分类","#TB_inline?height=80&width=250&inlineId=moveDiv","thickbox");
}

$(function(){
	$('#contentDiv > ul').tabs(); 
});
</script>

<html:link type="CSS" href="__PUBLIC__/Js/thickbox/thickbox.css" />
<html:link type="JS" href="__PUBLIC__/Js/thickbox/thickbox-compressed.js" />

<div id="box">
<h3>分类/Tag</h3>
<div id="contentDiv" style="padding:10px">
	<ul>
		<li><a href="#category"><span>分类管理</span></a></li>
		<li><a href="#tags"><span>Tag管理</span></a></li>
	</ul>
	<!--分类管理-->
	<div id="category">
		<table id="categorylist" class="list" cellpadding="0" cellspacing="0" >
		<thead>
		<tr>
			<th>分类名称</th><th>英文标识</th><th>分类描述</th><th>日志数</th><th>操作</th>
		</tr>
		</thead>
		<tbody>
		<volist name="categoryList" id="category">
		<tr>
			<td><a title="查看分类文章" target="_blank" href="index.php?s=/Category/{$category.slug|Input::forTag}">{$category.name|Input::forShow}</a></td>
			<td>{$category.slug|Input::forShow}</td>
			<td>{$category.description|Input::forShow}</td>
			<td>{$category.count}</td>
			<td width="120px" align="center"><a href="{:url('delCategory',MODULE_NAME,'',APP_NAME,array('cid'=>$category['cid']))}" onclick="return confirm('删除分类会把对应的日志一起删除，确认删除吗？');">删除</a>&nbsp;<a href="javascript:void(0)" onclick="$('#cid').attr('value','{$category.cid}');$('#name').attr('value','{$category.name|Input::forTag}');$('#slug').attr('value','{$category.slug|Input::forTag}');$('#description').attr('value','{$category.description|Input::forTag}');tb_show('编辑分类','#TB_inline?height=200&width=250&inlineId=categoryDiv','thickbox');">编辑</a>&nbsp;<a href="javascript:void(0)" onclick="showMoveDiv('{$category.cid}')">移动分类</a></td>
		</tr>
		</volist>
		</tbody>
		</table>
		<input type="button" value="添加分类" class="btn" onclick="tb_show('添加分类','#TB_inline?height=200&width=250&inlineId=categoryDiv','thickbox');" />
	</div>
	<!--TAG管理-->
	<div id="tags">
		<volist name="tagList" id="tag">
		<if condition="$options['use_balanceTags'] eq '1'">
		<a title="{$tag.num}篇日志" target="_blank" href="index.php?s=/Tag/{$tag.tag_name|urlencode}">{$tag.tag_name|Input::forShow}</a>
		<else />
		<a title="{$tag.num}篇日志" target="_blank" href="index.php?s=/Tag/{$tag.tag_name|urlencode}" style="font-size: {$tag.size}pt;">{$tag.tag_name|Input::forShow}</a>
		</if>
		 <a title="删除" href="{:url('delTag',MODULE_NAME,'',APP_NAME,array('tag_name'=>urlencode($tag['tag_name'])))}" onclick="return confirm('确认删除这个Tag吗？');"><img border="0" src="__PUBLIC__/Images/close.gif" /></a>
		</volist>
	</div>
</div>

<!--移动分类-->
<div id="moveDiv" style="display:none">
<form id="moveForm" method="POST" action="{:url('moveCategory')}">
将分类下的日志移动到&nbsp;<html:select class="select" id="newCid" name="newCid" options="categoryArray" />
<p align="center"><input type="submit" class="btn" value="确定" /></p><input type="hidden" name="originCid" id="originCid" />
</form>
</div>
<!--编辑/添加分类-->
<div id="categoryDiv" style="display:none">
<form id="categoryForm" method="POST" action="{:url('editCategory')}">
<p>分类名称&nbsp;<input type="text" id="name" name="name" class="txt" /></p>
<p>英文标识&nbsp;<input type="text" id="slug" name="slug" class="txt" /></p>
<p>分类描述&nbsp;<input type="text" id="description" name="description" class="txt" /></p>
<p align="center"><input type="submit" class="btn" value="确定" /></p><input type="hidden" name="cid" id="cid" />
</form>
</div>
</div>